Switch CI to uv and use build[uv] frontend for cibuildwheel#1615
Switch CI to uv and use build[uv] frontend for cibuildwheel#1615kkraus14 wants to merge 39 commits intoNVIDIA:mainfrom
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
0e6820a to
3505cf1
Compare
|
/ok to test |
3e1070a to
36cf441
Compare
|
/ok to test |
36cf441 to
9c9757f
Compare
|
/ok to test |
1 similar comment
|
/ok to test |
b5aaea0 to
a736c3d
Compare
|
/ok to test |
1 similar comment
|
/ok to test |
|
|
/ok to test |
| git_describe_command = ["git", "describe", "--dirty", "--tags", "--long", "--match", "cuda-core-v*[0-9]*"] | ||
|
|
||
| [tool.uv] | ||
| conflicts = [[{ extra = "cu12" }, { extra = "cu13" }]] |
|
/ok to test |
|
/ok to test |
|
There are build frontends? |
|
/ok to test |
6 similar comments
|
/ok to test |
|
/ok to test |
|
/ok to test |
|
/ok to test |
|
/ok to test |
|
/ok to test |
- Replace cuda-core[test] with {include-group = "test"} in cuda-core's
test-cu* dependency groups. The self-reference triggered setuptools_scm
via the build backend in CI containers without full git context.
- Pass VCToolsInstallDir through CIBW_ENVIRONMENT_PASS_WINDOWS and
prepend its bin dir to PATH so MSVC's link.exe is found instead of
Git's /usr/bin/link.exe when DISTUTILS_USE_SDK=1 skips vcvarsall.bat.
- Regenerate uv.lock.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
/ok to test |
The $VCToolsInstallDir PATH prepend via CIBW_ENVIRONMENT_WINDOWS did not take effect. Instead, rename Git's /usr/bin/link.exe (POSIX hardlink tool) before each cibuildwheel build so MSVC's linker is found on PATH when DISTUTILS_USE_SDK=1 skips vcvarsall.bat. Co-authored-by: Cursor <cursoragent@cursor.com>
|
/ok to test |
Use ${{ env.VCToolsInstallDir }} (resolved at YAML parse time) instead
of $VCToolsInstallDir (cibuildwheel runtime expansion, which silently
failed). This prepends the MSVC bin dir to PATH so link.exe resolves
to MSVC's linker instead of Git's /usr/bin/link.exe.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
/ok to test |
CIBW_ENVIRONMENT_WINDOWS PATH modifications were not being applied to the build subprocess. Instead, prepend the MSVC bin dir to PATH via GITHUB_PATH in the same step that sets DISTUTILS_USE_SDK=1, so it is inherited by all subsequent steps including cibuildwheel. Co-authored-by: Cursor <cursoragent@cursor.com>
|
/ok to test |
GITHUB_PATH prepend fixed cibuildwheel but not the Cython test build step which runs in a different venv context. Rename Git's /usr/bin/link.exe at the start of the job so MSVC's linker is found in all steps regardless of PATH ordering. Co-authored-by: Cursor <cursoragent@cursor.com>
|
/ok to test |
…-workspace Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # .github/workflows/coverage.yml # cuda_core/pyproject.toml
|
/ok to test |
cibuildwheel v3.3.x has a PATH mangling bug on Windows that causes Git's /usr/bin/link.exe to shadow MSVC's linker (pypa/cibuildwheel#2663). The fix (pypa/cibuildwheel#2723) is merged but not yet released. Downgrade to v3.2.1 which does not have the bug, removing all the workarounds: DISTUTILS_USE_SDK=1, CIBW_ENVIRONMENT_PASS_WINDOWS for MSVC vars, and the link.exe rename hack. Co-authored-by: Cursor <cursoragent@cursor.com>
|
/ok to test |
The CI uses uv pip install (not uv sync), so the workspace root
pyproject.toml and uv.lock provided no practical value. Remove them
along with workspace-only artifacts:
- Root pyproject.toml (workspace definition, cross-package conflicts)
- uv.lock and its .gitattributes / .pre-commit-config.yaml exclusions
- { workspace = true } source mappings in cuda_core and cuda_bindings
- cuda-pathfinder from cuda_core build-system.requires (was only needed
for the workspace resolver)
Per-package [tool.uv] conflicts (e.g. cu12 vs cu13 extras) are retained
in their respective pyproject.toml files.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
/ok to test |
…python These files had incidental changes (whitespace, quoting style, setuptools_scm config) that are outside the scope of the uv migration. Copyright year auto-updated by pre-commit hook. Co-authored-by: Cursor <cursoragent@cursor.com>
|
/ok to test |
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
/ok to test |
| # We already installed cuda-bindings, and all CTK components exist locally, | ||
| # so just install the test dependencies. | ||
| pip install "${CUDA_CORE_ARTIFACTS_DIR}"/*.whl --group "test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}" | ||
| uv pip install "${CUDA_CORE_ARTIFACTS_DIR}"/*.whl --group "test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}" |
There was a problem hiding this comment.
Blocking: in the LOCAL_CTK==1 core install path, the previous minor-version constraint on cuda-toolkit appears removed. Without pinning to the local CTK minor, dependency resolution can pull a newer runtime than the locally installed toolkit and reintroduce environment skew/flakiness.
| "numpy>=1.21.1", | ||
| "pytest>=6.2.4", | ||
| "pytest-benchmark>=3.4.1", | ||
| "pytest-randomly", |
There was a problem hiding this comment.
Nit (non-blocking): this adds a duplicate pytest-randomly entry in the test dependency group.
cpcloud
left a comment
There was a problem hiding this comment.
Requesting changes for one blocking issue: please restore a local-CTK minor pin in ci/tools/run-tests for the LOCAL_CTK==1 core install path (to avoid toolkit/runtime skew). The duplicate pytest-randomly entry I noted is just a non-blocking nit.
Summary
Replaces
pipwithuvacross all CI workflows and switches cibuildwheel to thebuild[uv]build frontend.CI workflow changes
uv build --wheelfor pathfinder/cuda-python,uv tool run twinefor wheel checks,uv venv+uv pip install --groupfor Cython test deps.setup-uvwithactivate-environment,uv pip installfor wheels +--groupfor dependency groups.uv pip install --systeminto conda env.setup-uvwithactivate-environment,uv pip install+--groupfor test deps.uv pip installfor wheels +--groupfor dependency groups.astral-sh/setup-uv@v7.3.0(pinned to SHA) withactivate-environment: truein test/coverage workflows.uv run --no-project --with wheelfor the cuda.core wheel merge step.cibuildwheel
build[uv]build frontend forcuda_bindingsandcuda_coreon all platforms.Package metadata
[dependency-groups]with test dependencies tocuda_bindingsandcuda_core.pytest-randomlytocuda_bindingstest dependency group.cuda-core[test]self-reference incuda_core'stest-cu*groups with{include-group = "test"}(PEP 735) to avoid triggering the build backend in CI.[tool.uv]cu12/cu13 extra conflicts tocuda_core.Key patterns
--group:uv pip install ./artifact.whl --group testinstalls a wheel and its test dependency group in one call. Groups must not self-reference the project (use{include-group = "..."}instead) to avoid triggering the build backend.uv pip install path/to/*.whlinstalls CI-built wheel artifacts into the venv.uv tool run twine check --strict *.whlanduv run --no-project --with wheel python script.pyavoid polluting the environment.Test plan